<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="newstyle.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Power of Prime input</title>
</head>
<body>
<div id="top">
<h2>Anthony Stone's root-rational-fraction program package</h2>
</div>
<div id="trail">
<p><a href="http://www-stone.ch.cam.ac.uk/">Home</a>
 -> <a href="http://www-stone.ch.cam.ac.uk/programs.html">Programs</a>
 -> <a href="index.html">RRF</a>
 -> <a href="routines.html">Subroutines and functions</a>
 -> power-of-prime notation</p>
</div>

<!-- Index starts here -->
<div id="index">
<p class="indexentry"><a href="http://www-stone.ch.cam.ac.uk/index.html">Home</a></p>
<p class="indexentry"><a href="http://www-stone.ch.cam.ac.uk/personal/personal.html">Personal information</a></p>
<p class="indexentry"><a href="http://www-stone.ch.cam.ac.uk/programs.html">Computer programs</a></p>
<p class="indexentry"><a
href="http://www.ch.cam.ac.uk/staff/ajs.html">Research details</a></p>
<p class="indexentry"><a href="http://www-stone.ch.cam.ac.uk/personal/timf.html">The Theory of Intermolecular Forces</a></p>
<p class="indexentry"><a href="http://www-stone.ch.cam.ac.uk/personal/bibliography.html">Publications</a></p>
<p class="indexentry"><a href="http://www-stone.ch.cam.ac.uk/personal/supplementary.html">
Supplementary material for published papers</a></p>
</div>
<!-- Index ends here -->

<div id="content">

<h2>Power of Prime input and output</h2>
<p>Numbers to be read in power-of-prime form must be written as</p>
<p><i>sign x</i>(1) <i>x</i>(2) ... <i>x</i>(<code>NP</code>)
  [<i>prime</i>[^<i>exp</i>]] ... [[.] <i>n</i>![^<i>exp</i>]] ...</p>
<p>The sign factor must be present (even for positive numbers). It is followed
by exponents for the first <code>NP</code> primes; <code>NP</code> is
specified as an argument to the PP_TO_RRF routine, and may be zero. The 
remaining elements of this expression are optional, as indicated by the
square brackets (which should not themselves appear). Each element represents
a factor in the required number; that is, the elements are multiplied together
to arrive at the result. Numbers output in power-of-prime form appear in
the same format. <a href="#examples">Examples</a> are given below.</p>
<dl>
<dt><i>sign</i> 
<dd>is either 0 (denoting a zero value) or +, (+)1, (+)i, -(1), or -i (the sign
term of a positive number may not be omitted). 
<dt><i>prime^exp</i> 
<dd>represents a factor comprising the specified prime number <i>prime</i> raised to the power <i>exp</i>. E.g. 5^2 represents the factor 25. The exponent may be omitted if it is
1. 
<dt><i>n</i>!^<i>exp</i> 
<dd>is read as <i>n</i> factorial raised to the exponent given. The exponent may be omitted if
it is 1. 
</dl>
<p>Prime and factorial terms may occur in any order and may be interspersed
with each other. Neither may contain embedded blanks, but they are separated
by blanks or period, `.'.The ^ introducing an exponent may be omitted if
the first character of the exponent is + or -. Exponents have the form [-]<i>nnn</i>..[/2].</p>
<p><a name="examples">Examples</a>: Uisng NP=0, the line</p>
<p><code>+ 2^-1/2 . 3^1/2 . 5+1/2 . 7-1/2 . 4!</code></p>
<p>would be read as 24 sqrt(15/14). Using NP=4 the same number could be input
as</p>
<p><code>+ -1/2 1/2 1/2 -1/2 4!</code></p>
<p>or as</p>
<p><code>+ 5/2 3/2 1/2 -1/2</code></p>
</div>
<!--		Ends Here			-->

<div id="foot">
<!--#config timefmt="%d %B, %Y" -->
<p>This file was last revised by 
<a href="http://www-stone.ch.cam.ac.uk/">Anthony Stone</a> 
(<a href="mailto:ajs1@cam.ac.uk">ajs1@cam.ac.uk</a>) on <!--#flastmod file="ppx.html" -->.</p>
</div>
<div id="w3valid">
<p>
    <a href="http://validator.w3.org/check?uri=referer"><img
      src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional" height="31" width="88"></a>
  </p>
</div>
</body>
</html>
